package com.horay.springclouddemo.feign.nacos.service;

import com.horay.springclouddemo.feign.nacos.configuration.NacosFeignConfiguration;
import com.horay.springclouddemo.feign.nacos.fallback.NacosClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Class description
 *
 * @author heyingcheng
 * @date 2019/11/2 17:52
 */
@FeignClient(name = "nacos-client", fallback = NacosClientFallback.class, configuration = NacosFeignConfiguration.class)
public interface NacosClientService {

    @GetMapping("/echo/{str}")
    String echo(@PathVariable("str") String str);

    @GetMapping("/divide")
    String divide(@RequestParam("a") Integer a, @RequestParam("b") Integer b);

    default String divide(Integer a) {
        return divide(a, 0);
    }

    @GetMapping("/notFound")
    String notFound();

}